// store/user.js
export default {
	namespaced: true,
	state() {
		return {
			// 初始一个状态数据
			address: uni.getStorageSync('address') || null,
		}
	},
	getters: {
		fullAddress(state) {
			if (!state.address) return '';
			const { provinceName, cityName, countyName, detailInfo } = state.address;
			return provinceName + cityName + countyName + detailInfo
		}
	},
	mutations: {
		saveAddress(state, address) {
			state.address = address
			// 存入本地
			uni.setStorageSync('address', address)
		}
	}
}
